<template>
    <el-form :inline="true" ref="queryForm">
<!--        <el-form-item label="指定链接">-->
<!--            <el-input v-model="formFilter.videoUrlVal" placeholder="请输入链接"></el-input>-->
<!--        </el-form-item>-->
        <el-form-item label="评论间隔">
            <el-input v-model="formFilter.ainterval" style="width: 80px;"></el-input>
            S
        </el-form-item>
        <el-form-item label="是否限制评论数量">
            <el-input v-model="formFilter.limitFlag" placeholder="默认不限制"></el-input>
        </el-form-item>
<!--        <el-form-item>-->
<!--            <el-button type="success" icon='el-icon-video-play' style="width: 300px" @click="startAttention">开始关注</el-button>-->
<!--            <el-button type="success" icon='el-icon-video-pause' @click="stop">暂停</el-button>-->
<!--        </el-form-item>-->
<!--        <el-form-item label="群发对象">-->
<!--            <el-select v-model="formFilter.type" placeholder="群发对象">-->
<!--                <el-option-->
<!--                        v-for="(item, key) in typeKv"-->
<!--                        :key="key"-->
<!--                        :label="item"-->
<!--                        :value="key">-->
<!--                </el-option>-->
<!--            </el-select>-->
<!--        </el-form-item>-->
        <el-divider></el-divider>
        <el-upload
                style="display: inline-block; margin-right: 10px;"
                action="/upload/file"
                :http-request="upload"
                :show-file-list='false'
                multiple>
            <el-button type="success" plain size="mini">导入群发数据</el-button>
        </el-upload>
        <el-button type="success" size="mini" @click="onRest">清空</el-button>
        <el-input v-model="pagination.nickName" size="mini" placeholder="请输入用户昵称" style="width: 200px;"></el-input>
        <el-button type="success" size="mini" @click="getFn">搜索</el-button>
    </el-form>
</template>

<script>
  import datePicker from '@/components/datePicker'
  import { TYPE_KV } from '@/utils/constant'
  import { startAttention, stop, getTaskProcessMessage } from '@/api/attention'
  import {upload} from '@/api/users'
  import eventBus from "../../utils/eventBus";

  export default {
    name: "tool",
    components: {
      datePicker
    },
    data () {
      return {
        options: ['通过', '拒绝'],
        typeKv: TYPE_KV
      }
    },
    props: {
      get: Function,
      formFilter: Object,
      pagination: Object
    },
    methods: {
      queryFn () {
        this.get()
      },
      upload (config) {
        const formData = new FormData()
        formData.append('file', config.file)
        formData.append('type', '30')
        return upload(formData).then(() => {
          this.$message.success('导入视频成功')
          this.get()
        })
      },
      onRest() {
        this.$emit('clear')
        eventBus.$emit('restTable')
      },
      getFn() {
        this.pagination.pageIndex = 1
        this.get()
      }
    }
  }
</script>

<style scoped>

</style>
